package org.ffmmx.ybb.model;

import java.util.ArrayList;
import java.util.Collection;

public class Result<T> {
    Integer code;
    Boolean success;
    String msg;
    Collection<T> data = new ArrayList<>();
    Exception exception;

    public Result(T data) {
        this.data.add(data);
    }

    public Result() {
    }

    public Result(Collection<T> data) {
        this.data.addAll(data);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Boolean getSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Collection<T> getData() {
        return data;
    }

    public void setData(Collection<T> data) {
        this.data = data;
    }

    public Exception getException() {
        return exception;
    }

    public void setException(Exception exception) {
        this.exception = exception;
    }
}
